#!/usr/bin/python
# author dennis
# 2022年06月15日
import threading
import time


def write():
    for i in range(3):
        my_list.append(i)
        print("add:%d" % i)
    print("write_data:", my_list)


def read():
    print("read_data:", my_list)


if __name__ == '__main__':
    my_list = []
    print(my_list)

    write_thread = threading.Thread(target=write)
    read_thread = threading.Thread(target=read)

    write_thread.start()
    time.sleep(1)
    read_thread.start()

    print(my_list)
